#define _CRT_SECURE_NO_WARNINGS 2

#include<stdio.h>
#include<stdlib.h>
#include<stdbool.h>
#include<assert.h>



 typedef struct TreeNode {
	 int val;
	 struct TreeNode* left;
	 struct TreeNode* right;
	 
}TreeNode;  

 typedef TreeNode datatype;

 typedef struct Node {
	 datatype val;
	 struct Node* next;
 }Node;

 typedef struct Queue {
	  Node* front;
	  Node* rear;
	  int num;
 }Queue;

 void QueueInit(Queue* pq) {
	 pq->front = pq->rear = NULL;
	 pq->num = 0;
 }

 void QueuePush(Queue** ppq,datatype x) {
	 assert(ppq);
	 assert(*ppq);
	 Node* newnode = (Node*)malloc(sizeof(Node));
	 newnode->next = NULL;
	 newnode->val = x;
	 if (!newnode) {
		 perror("fail malloc");
		 return;
	 }
	 if ((*ppq)->num == 0) {
		 (*ppq)->front = (*ppq)->rear = newnode;
	 }
	 else {
		 (*ppq)->rear->next = newnode;
	 }
	 (*ppq)->num++;
 }

 bool QueueEmpty(Queue* pq) {
	 assert(pq);
	 return pq->num == 0;
 }

 void QueuePop(Queue* pq) {
	 assert(pq);
	 assert(!QueueEmpty(pq));
	 Node* tmp = pq->front;
	 pq->front = pq->front->next;
	 pq->num--;
	 free(tmp);
	 tmp = NULL;
 }

 datatype QueueFront(Queue* pq) {
	 assert(pq);
	 assert(!QueueEmpty(pq));
	 return pq->front->val;
 }

 datatype QueueRear(Queue* pq) {
	 assert(pq);
	 assert(!QueueEmpty(pq));
	 return pq->rear->val;
 }

 struct TreeNode* CreateBST(int* a, int n) {

 }

 struct TreeNode* sortedArrayToBST(int* nums, int numsSize) {
	 return CreateBST(nums, numsSize);
 }

 int main() {

	 return 0;
 }